﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RoleManage.aspx.cs" Inherits="StoragePeriod.Web.SysManage.RoleManage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        $(function () { 
            
            $("#add-user").click(function () {
                var src = '../UserControls/Picker.aspx?rolecode={0}&type={1}';
                var rolecode = $("[id$=hdRoleCode]").val();

                $("#idialogView").attr('src', src.format(rolecode, 'user'));
                $("#dialog-form").dialog('open');
                return false;
            });
            $("#add-priv").click(function () {
                var src = '../UserControls/Picker.aspx?rolecode={0}&type={1}';
                var rolecode = $("[id$=hdRoleCode]").val();

                $("#idialogView").attr('src', src.format(rolecode, 'privilege'));
                $("#dialog-form").dialog('open');
                return false;
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainLeft" runat="server">
    <asp:TreeView ID="tvRoleView" runat="server" 
    onselectednodechanged="tvRoleView_SelectedNodeChanged">
        <SelectedNodeStyle Font-Bold="True" />
    </asp:TreeView>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <h1>角色权限</h1>
 <div class="ui-widget">
    
    <button class="ui-button" id="add-priv">Create new user</button>
    <asp:GridView ID="gvRoleprivilegeView" runat="server" CssClass="sp-common-table ui-widget ui-widget-content"
        AllowPaging="True" DataKeyNames="PrivCode,RoleCode" 
         onrowdeleting="gvprivilegeView_RowDeleting" 
         onpageindexchanging="gvRoleprivilegeView_PageIndexChanging">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
        <HeaderStyle CssClass="ui-widget-header" />
    </asp:GridView>
</div>
  
<br />
<hr />
<br />

<h1>角色人员</h1>
<div class="ui-widget">
<button class="ui-button" id="add-user">Create new user</button>
    <asp:GridView ID="gvRoleUserView" runat="server" CssClass="sp-common-table ui-widget ui-widget-content"
        AllowPaging="True" DataKeyNames="UserCode,RoleCode" 
        onrowdeleting="gvRoleUserView_RowDeleting" 
        onpageindexchanging="gvRoleprivilegeView_PageIndexChanging" >
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
        <HeaderStyle CssClass="ui-widget-header" />
    </asp:GridView>
</div>

<div class="die">
    <div id="dialog-form"> 
        <iframe id="idialogView" scrolling="no" frameborder="0" src="../UserControls/Picker.aspx?rolecode={0}&type=privilege"></iframe>
    </div>
    <asp:HiddenField ID="hdRoleCode" runat="server" />
</div>

</asp:Content>
